package com.mbj.course.cash.model.user;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

// 创建用户表（主键、用户名（唯一）、密码）

@Slf4j
@Data
public class User {
    private Integer userId;    // 保留 Integer 而不是 int，是想保存 null
    private String username;
    private String password;

    // 无参构造方法是给 Mybatis 使用
    public User() {
        log.debug("model.user.User()");
    }

    public User(String username, String password) {
        log.debug("model.user.User(username = {}, password = {})", username, password);
        this.username = username;
        this.password = password;
    }

    public void setUserId(Integer userId) {
        log.debug("model.user.User.setUserId(userId = {})", userId);
        this.userId = userId;
    }

    public void setUsername(String username) {
        log.debug("model.user.User.setUsername(username = {})", username);
        this.username = username;
    }

    public void setPassword(String password) {
        log.debug("model.user.User.setPassword(password = {})", password);
        this.password = password;
    }

}
